package com.attendance.chdingtask.controller;


import com.attendance.chdingtask.config.WebLog;
import com.attendance.chdingtask.model.AuthInfo;
import com.attendance.chdingtask.model.MdArea;
import com.attendance.chdingtask.service.MdAreaService;
import com.attendance.chdingtask.utils.common.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(value = "area", description = "位置维护", consumes = "application/json;charset=UTF-8")
@RequestMapping(value = "/area")
public class AreaController extends BaseController{
    @Autowired
    private MdAreaService areaService;

    @PostMapping("/add")
    @ResponseBody
    @WebLog(description = "位置维护")
    @ApiOperation(value = "位置维护", notes = "{}")
    public Result sendMessage(@RequestBody MdArea area){
        try{
            areaService.save(area);
        }catch (Exception e){
            return Result.error(e.getMessage());
        }
        return Result.success();
    }
}
